<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue 购物车</title>
    <link rel="stylesheet" href="./assets/iconfont.css">
    <link rel="stylesheet" href="./style.css">
    <script src="./data.js" defer></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.4.37/vue.global.prod.min.js" defer></script>
    <script src="./index.js" defer></script>
</head>

<body>
    <div class="container">
        <h3 class="goods-title">{{title}}</h3>
        <div class="goods-list">
            <div class="goods-item" v-for="item,index in goodsList" :key="index" :class="{choose: item.choose > 0}">
                <div class="name">{{item.name}}</div>
                <div class="goods-btn">
                    <i class="goods-sub iconfont icon-jian" @click="item.choose--"></i>
                    <div class="goods-num">{{item.choose}}</div>
                    <i class="goods-add iconfont icon-jia" @click="item.choose++"></i>
                </div>
            </div>
        </div>
        <div class="footer-cart" :class="{active:total>0}">
            <i class="iconfont icon-gouwuche"></i>
            <div class="footer-cart-count">{{total}}</div>
        </div>
    </div>
</body>

</html>